// default package
// Generated 28 Jul, 2014 8:04:07 PM by Hibernate Tools 3.4.0.CR1
package com.galaxy.bean;

import java.util.HashSet;
import java.util.Set;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.JoinTable;
import javax.persistence.ManyToMany;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.UniqueConstraint;

/**
 * Rating generated by hbm2java
 */
@Entity
@Table(name = "rating", catalog = "magento", uniqueConstraints = @UniqueConstraint(columnNames = "rating_code"))
public class Rating implements java.io.Serializable {
	private static final long serialVersionUID = 121323L;

	private Short ratingId;
	private RatingEntity ratingEntity;
	private String ratingCode;
	private short position;
	private Set ratingTitles = new HashSet(0);
	private Set ratingOptionVoteAggregateds = new HashSet(0);
	private Set coreStores = new HashSet(0);
	private Set ratingOptions = new HashSet(0);

	public Rating() {
	}

	public Rating(RatingEntity ratingEntity, String ratingCode, short position) {
		this.ratingEntity = ratingEntity;
		this.ratingCode = ratingCode;
		this.position = position;
	}

	public Rating(RatingEntity ratingEntity, String ratingCode, short position,
			Set ratingTitles, Set ratingOptionVoteAggregateds, Set coreStores,
			Set ratingOptions) {
		this.ratingEntity = ratingEntity;
		this.ratingCode = ratingCode;
		this.position = position;
		this.ratingTitles = ratingTitles;
		this.ratingOptionVoteAggregateds = ratingOptionVoteAggregateds;
		this.coreStores = coreStores;
		this.ratingOptions = ratingOptions;
	}

	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "rating_id", unique = true, nullable = false)
	public Short getRatingId() {
		return this.ratingId;
	}

	public void setRatingId(Short ratingId) {
		this.ratingId = ratingId;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "entity_id", nullable = false)
	public RatingEntity getRatingEntity() {
		return this.ratingEntity;
	}

	public void setRatingEntity(RatingEntity ratingEntity) {
		this.ratingEntity = ratingEntity;
	}

	@Column(name = "rating_code", unique = true, nullable = false, length = 64)
	public String getRatingCode() {
		return this.ratingCode;
	}

	public void setRatingCode(String ratingCode) {
		this.ratingCode = ratingCode;
	}

	@Column(name = "position", nullable = false)
	public short getPosition() {
		return this.position;
	}

	public void setPosition(short position) {
		this.position = position;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "rating")
	public Set getRatingTitles() {
		return this.ratingTitles;
	}

	public void setRatingTitles(Set ratingTitles) {
		this.ratingTitles = ratingTitles;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "rating")
	public Set getRatingOptionVoteAggregateds() {
		return this.ratingOptionVoteAggregateds;
	}

	public void setRatingOptionVoteAggregateds(Set ratingOptionVoteAggregateds) {
		this.ratingOptionVoteAggregateds = ratingOptionVoteAggregateds;
	}

	@ManyToMany(fetch = FetchType.LAZY)
	@JoinTable(name = "rating_store", catalog = "magento", joinColumns = { @JoinColumn(name = "rating_id", nullable = false, updatable = false) }, inverseJoinColumns = { @JoinColumn(name = "store_id", nullable = false, updatable = false) })
	public Set getCoreStores() {
		return this.coreStores;
	}

	public void setCoreStores(Set coreStores) {
		this.coreStores = coreStores;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "rating")
	public Set getRatingOptions() {
		return this.ratingOptions;
	}

	public void setRatingOptions(Set ratingOptions) {
		this.ratingOptions = ratingOptions;
	}

}
